#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin >> n;
    int ret = 0;
    int t = n, b = 0;
    while (n--)
    {
        int x = 0;
        cin >> x;
        t--;
        if (b % 2 == 1)ret ^= x;
        if (t % 2 == 1)ret ^= x;
        b++;
    }
    cout << ret;



    return 0;
}